package com.wenson.structural.facade;


/**
 * @ClassName: Facade
 * @Author: luowangcheng
 * @Date: 2024/6/13 8:46
 * @Description:
 */
public class Facade {
    private VegVendor vegVendor;
    private Chef chef;
    private Waiter waiter;
    private Cleaner cleaner;

    public Facade() {
        this.vegVendor = new VegVendor();
        // 开门前准备好蔬菜
        vegVendor.purchase();
        this.chef = new Chef(); // 雇佣厨师
        this.waiter = new Waiter(); // 雇佣服务员
        this.cleaner = new Cleaner(); // 雇佣清洁工、洗碗工
    }

    public void order(){
        waiter.order(); // 接待、入座、点菜
        chef.cook(); // 做饭
        waiter.serve(); // 上菜
        cleaner.clean(); // 收拾桌子
        cleaner.wash(); // 洗碗
    }
}
